#include <stdio.h>
#include <unistd.h>

int main(int argc , char const *argv[])
{
    char buf[65536]="";
    int fd[2]={0};
    if(pipe(fd)==-1)
    {
        perror("pipe err\n");
        return -1;
    }

    printf("%d %d\n",fd[0],fd[1]);

    //read(fd[0],buf,5);
    //printf("%s\n",buf);

    write(fd[1],buf,65536);
    printf("write full\n");
/*    write(fd[1],"hello",5);
    printf("write after\n");*/

/*    read(fd[0],buf,4096);
    write(fd[1],"hello",5);
    printf("write after\n");*/

    close(fd[0]);
    write(fd[1],"hello",5);
    printf("read closed\n");

    return 0;
}